#include "AllocObject.h"


void*GlueObject::OSMalloc(unsigned int x)
{
	return malloc(x);
}
void GlueObject::OSFree(void*p)
{
	return free(p);
}
void* GlueObject::OSCalloc(unsigned int count, unsigned int size)
{
	return calloc(count, size);
}
void *GlueObject::OSRealloc(void *p, unsigned int oldsize, unsigned int newsize)
{
	return realloc(p, newsize);
}

GlueObject::~GlueObject()
{

}
GlueObject::GlueObject()
{

}

void* OSMalloc(unsigned int size)
{
	return GlueObject::OSMalloc(size);
}
void OSFree(void*p)
{
	GlueObject::OSFree(p);
}
void* OSCalloc(unsigned int count, unsigned int size)
{
	return GlueObject::OSCalloc(count, size);
}
void*	OSRealloc(void *p, unsigned int oldsize, unsigned int newsize)
{
	return GlueObject::OSRealloc(p,oldsize,  newsize);
}

int UTF8to16 (const char *pSrc,size_t sourceLength, wchar_t *target, size_t* targetLength)
{
	int nResult=1;
	int ulTar=0;

	if(!pSrc||!target||!targetLength)return 1;

	ulTar=MultiByteToWideChar(CP_UTF8, 0, pSrc, sourceLength, target, *targetLength);
	if(ulTar>0)
	{
		target[ulTar] =0;
		*targetLength=ulTar;
		return 0;
	}
	return 1;

}